<template>
  <div class="app">
    <p>主页面</p>
    <div>
      <button @click="goRouter('ahome')">跳转 home</button>
      <button @click="goRouter('about')">跳转 about</button>
    </div>
    <br />
    <div class="router">
      <router-view></router-view>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";

const $router = useRouter();
function goRouter(_page) {
  $router.push({
    name: _page,
  });
}
</script>

<style scoped lang="scss">
.router {
  background-color: aqua;
  padding: 10px;
}
.app {
  background-color: darkcyan;
  padding: 10px;
}
</style>
